package com.laowang.project.system.service.impl;

import java.util.List;

import com.laowang.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.laowang.project.system.mapper.TbProxyRebateMapper;
import com.laowang.project.system.domain.TbProxyRebate;
import com.laowang.project.system.service.TbProxyRebateService;

/**
 * 代理返利Service业务层处理
 *
 * @author laowang
 * @date 2023-01-16
 */
@Service
public class TbProxyRebateServiceImpl implements TbProxyRebateService {
    @Autowired
    private TbProxyRebateMapper tbProxyRebateMapper;

    /**
     * 查询代理返利
     *
     * @param id 代理返利ID
     * @return 代理返利
     */
    @Override
    public TbProxyRebate selectTbProxyRebateById(Long id) {
        return tbProxyRebateMapper.selectTbProxyRebateById(id);
    }

    /**
     * 查询代理返利列表
     *
     * @param tbProxyRebate 代理返利
     * @return 代理返利
     */
    @Override
    public List<TbProxyRebate> selectTbProxyRebateList(TbProxyRebate tbProxyRebate) {
        return tbProxyRebateMapper.selectTbProxyRebateList(tbProxyRebate);
    }

    /**
     * 新增代理返利
     *
     * @param tbProxyRebate 代理返利
     * @return 结果
     */
    @Override
    public int insertTbProxyRebate(TbProxyRebate tbProxyRebate) {
        tbProxyRebate.setCreateTime(DateUtils.getNowDate());
        return tbProxyRebateMapper.insertTbProxyRebate(tbProxyRebate);
    }

    /**
     * 修改代理返利
     *
     * @param tbProxyRebate 代理返利
     * @return 结果
     */
    @Override
    public int updateTbProxyRebate(TbProxyRebate tbProxyRebate) {
        return tbProxyRebateMapper.updateTbProxyRebate(tbProxyRebate);
    }

    /**
     * 批量删除代理返利
     *
     * @param ids 需要删除的代理返利ID
     * @return 结果
     */
    @Override
    public int deleteTbProxyRebateByIds(Long[] ids) {
        return tbProxyRebateMapper.deleteTbProxyRebateByIds(ids);
    }

    /**
     * 删除代理返利信息
     *
     * @param id 代理返利ID
     * @return 结果
     */
    @Override
    public int deleteTbProxyRebateById(Long id) {
        return tbProxyRebateMapper.deleteTbProxyRebateById(id);
    }
}
